export const metadata = {
  sidebar_position: 7,
  locale: "pt-BR",
  style: "chicago",
  title: "🟡 Prompts to Tipo Menor para o Maior",
};

# 🟡 Prompts to Tipo Menor para o Maior

Prompts do tipo "Menor para o Maior" (MpM) (Least to Most prompting ou LtM, em inglês)(@zhou2022leasttomost) são uma extensão dos prompts to tipo %%Cadeia de Pensamento - CdP|CoT prompting%%. Contudo esse tipo de prompt quebra o problema principal em diversos problemas menores. Essa técnica é inspirada em estratégias aplicadas no ensino infantil.

Como na técnica de CdP prompting, o problema a ser resolvido é decomposto em um conjunto de subproblemas que se constroem uns sobre os outros. Em um segundo momento, esses subproblemas são resolvidos um por um. Contrariamente à cadeia de pensamento, a solução dos subproblemas anteriores é inserida na prompt tentando resolver o próximo problema.

<div style={{ textAlign: "center" }}>
  <Image
    src="/docs/assets/intermediate/least_to_most_formal.webp"
    width={1080}
    height={752}
    style={{ width: "600px", margin: "auto" }}
  />
</div>

<div style={{ textAlign: "center" }}>
  Diagrama representando o prompt Menor para o Maior (MpM)
</div>

## Examplo: Resposta de Solicitação de Cliente

Vamos fazer uma pergunta um pouco complicada:

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoyMjAsIm91dHB1dCI6Ik9icmlnYWRvIHBvciBlbnRyYXIgZW0gY29udGF0byBjb25vc2NvLiBJbmZlbGl6bWVudGUsIGNvbW8gdm9jw6ogY29tcHJvdSBhIGNhbWlzZXRhIGVtIDEwIGRlIG1hcsOnbywgZWxhIGVzdMOhIGZvcmEgZGEgbm9zc2EgcG9sw610aWNhIGRlIGRldm9sdcOnw6NvIGRlIDMwIGRpYXMuIE5vIGVudGFudG8sIGF0dWFsbWVudGUgdGVtb3MgdW0gZGVzY29udG8gZGUgNTAlIGVtIHRvZGFzIGFzIGNhbWlzZXRhcywgZW50w6NvIHZvY8OqIHBvZGVyaWEgY29tcHJhciBkdWFzIGNhbWlzZXRhcyBjb20gbyB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NhbWlzZXRhcy4gT3MgcHJlw6dvcyBkYXMgY2FtaXNldGFzIHZhcmlhbSBkZSBSJDE4IGEgUiQxMDAgZW0gc3VhIGxvamEuIE7Do28gaW52ZW50ZSBpbmZvcm1hw6fDtWVzIHNvYnJlIHBvbMOtdGljYXMgZGUgZGVzY29udG8uIiwibW9kZWwiOiJ0ZXh0LWRhdmluY2ktMDAzIn0%3D"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

<br />
A resposta está incorreta (o cliente está dentro da janela em que é possível retornar
o produto). Sendo assim, vamos dividir o problema em questões menores. Vamos tentar
resolver o primeiro subproblema:
<br />

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoyNTYsIm91dHB1dCI6IlxuQ2xhcm8hIFZhbW9zIHZlcmlmaWNhciBwYXNzbyBhIHBhc3NvIHNlIGEgY29tcHJhIGRhIGNhbWlzZXRhIGZvaSBmZWl0YSBkZW50cm8gZGEgcG9sw610aWNhIGRlIGRldm9sdcOnw6NvIGRlIDMwIGRpYXM6XG5cblBhc3NvIDE6IENhbGN1bGFyIGEgZGF0YSBsaW1pdGUgcGFyYSBkZXZvbHXDp8Ojb1xuQSBkYXRhIGRhIGNvbXByYSBkYSBjYW1pc2V0YSBmb2kgZW0gMTAgZGUgbWFyw6dvLiBQYXJhIHZlcmlmaWNhciBzZSBlc3TDoSBkZW50cm8gZG8gcHJhem8gZGUgMzAgZGlhcywgdmFtb3MgY29udGFyIDMwIGRpYXMgYSBwYXJ0aXIgZGVzc2EgZGF0YS5cblxuMTAgZGUgbWFyw6dvICsgMzAgZGlhcyA9IDkgZGUgYWJyaWxcblxuUGFzc28gMjogVmVyaWZpY2FyIGEgZGF0YSBhdHVhbFxuQSBkYXRhIGF0dWFsIMOpIDI5I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gcHJlw6dvcyBkYXMgY2FtaXNldGFzIHZhcmlhbSBkZSBSJDE4IGEgUiQxMDAgZW0gc3VhIGxvamEuIE7Do28gaW52ZW50ZSBpbmZvcm1hw6fDtWVzIHNvYnJlIHBvbMOtdGljYXMgZGUgZGVzY29udG8uXG5cblZlcmlmaWNhciBzZSBhIGNvbXByYSBkYSBjYW1pc2V0YSBmb2kgZmVpdGEgZGVudHJvIGRhIHBvbMOtdGljYSBkZSBkZXZvbHXDp8OjbyBkZSAzMCBkaWFzLiBWYW1vcyBwZW5zYXIgcGFzc28gYSBwYXNzby4iLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

Ao resolver apenas o primeiro subproblema, fomos capazes de resolver o problema inteiro. Se o GPT-3 não retornasse uma resposta imediatamente, poderíamos ter resolvido o próximo subproblema e assim por diante até que ele retornasse uma resposta. Observe que usamos `Vamos pensar passo a passo`. A adição dessa frase nem sempre é necessária, mas ajuda neste exemplo.

## Examplo: Concatenação de Letras

O MpM foi originalmente introduzido usando promptings de poucas amostras, em vez de uma instrução explícita para dividir um problema em várias etapas (como visto acima). Além disso, às vezes pode ser implementado com um único prompt em vez de prompts encadeados. Vamos examinar o problema de concatenar a última letra de palavras individuais (@wei2022chain) (por exemplo, dadas as palavras `bolo, etimologia` como entrada, a saída deve ser `oa`).

### Primeira tentativa: Padrão

O prompt padrão com alguns exemplos few-shot tem uma performance muito ruim, mesmo com um modelo mais avançado como o text-davinci-003.

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoxOTcsIm91dHB1dCI6ImNiZyIsInByb21wdCI6IlA6IHBlbnNhciwgbcOhcXVpbmFcblI6IHJhXG5cblA6IGFwcmVuZGVuZG8sIHBlbnNhbmRvLCBnZW5lcmFsaXphbmRvXG5SOiBvb29cblxuUDogYXJ0aWZpY2lhbCwgaW50ZWxpZ8OqbmNpYVxuUjogbGFcblxuUDogdHJhbnNmb3JtYWRvciwgbGluZ3VhZ2VtLCB2aXPDo29cblI6IHJtb1xuXG5QOiBjw6l1LCBiYXIsIGZsb3IsIGdhdG9cblI6IiwibW9kZWwiOiJ0ZXh0LWRhdmluY2ktMDAzIn0%3D"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### Segunda tentativa: Cadeia de Pensamento

A técnica da cadeia de pensamento funciona significativamente melhor do que a técnica padrão de prompt. Isso ocorre porque ela permite que o modelo considere extrair a última letra de cada palavra por conta própria, reduzindo a complexidade da operação de agrupar as letras coletadas anteriormente. No entanto, essa técnica começa a se tornar menos eficiente em tamanhos maiores.

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoyNzYsIm91dHB1dCI6IkEgw7psdGltYSBsZXRyYSBkZSBcImZvb1wiIMOpIFwib1wiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJiYXJcIiDDqSBcInJcIi4gQSDDumx0aW1hIGxldHJhIGRlIFwiYmF6XCIgw6kgXCJ6XCIuIEEgw7psdGltYSBsZXRyYSBkZSBcImJsaXBcIiDDqSBcInBcIi4gUG9ydGFudG8sIFwiZm9vLCBiYXIsIGJheiwgYmxpcFwiIMOpIFwib3J6cFwiLiIsInByb21wdCI6IlA6IHBlbnNhciwgbcOhcXVpbmFcblI6IEEgw7psdGltYSBsZXRyYSBkZSBcInBlbnNhclwiIMOpIFwiclwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJtw6FxdWluYVwiIMOpIFwiYVwiLiBQb3J0YW50bywgXCJwZW5zYXIsIG3DoXF1aW5hXCIgw6kgXCJyYVwiLlxuXG5QOiBhcHJlbmRpemFnZW0sIHJhY2lvY8OtbmlvLCBnZW5lcmFsaXphw6fDo29cblI6IEEgw7psdGltYSBsZXRyYSBkZSBcImFwcmVuZGl6YWdlbVwiIMOpIFwibVwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJyYWNpb2PDrW5pb1wiIMOpIFwib1wiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJnZW5lcmFsaXphw6fDo29cIiDDqSBcIm9cIi4gUG9ydGFudG8sIFwiYXByZW5kaXphZ2VtLCByYWNpb2PDrW5pbywgZ2VuZXJhbGl6YcOnw6NvXCIgw6kgXCJtb29cIi5cblxuUDogYXJ0aWZpY2lhbCwgaW50ZWxpZ8OqbmNpYVxuUjogQSDDumx0aW1hIGxldHJhIGRlIFwiYXJ0aWZpY2lhbFwiIMOpIFwibFwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJpbnRlbGlnw6puY2lhXCIgw6kgXCJhXCIuIFBvcnRhbnRvLCBcImFydGlmaWNpYWwsIGludGVsaWfDqm5jaWFcIiDDqSBcImxhXCIuXG5cblA6IHRyYW5zZm9ybWFkb3IsIGxpbmd1YWdlbSwgdmlzw6NvXG5SOiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJ0cmFuc2Zvcm1hZG9yXCIgw6kgXCJyXCIuIEEgw7psdGltYSBsZXRyYSBkZSBcImxpbmd1YWdlbVwiIMOpIFwibVwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJ2aXPDo29cIiDDqSBcIm9cIi4gUG9ydGFudG8sIFwidHJhbnNmb3JtYWRvciwgbGluZ3VhZ2VtLCB2aXPDo29cIiDDqSBcInJtb1wiLlxuXG5QOiBmb28sYmFyLGJheixibGlwXG5SOiIsIm1vZGVsIjoidGV4dC1kYXZpbmNpLTAwMyJ9"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### Terceira tentativa: Menor para o Maior Third (prompt único)

Com a técnica de "Menor para Maior", aprimoramos o conceito de "Cadeia de Pensamento" alterando cada etapa para reformular o resultado previamente concatenado. Isso simplifica cada etapa, pois a máquina deve pconcatenar apenas uma única letra nova. Isso leva a um bom desempenho, principalmente quando trabalhamos com 12 ou mais palavras.

Essa abordagem pode parecer muito semelhante à Cadeia de Pensamento, mas é conceitualmente muito diferente. Aqui, em cada etapa, introduzimos a concatenação anterior. No caso de "pensar, máquina, aprendendo", em vez de concatenar as letras "r", "a", "o" individualmente, concatenaremos "r" e "a", depois "ra" e "o". Como resultado dessa reintrodução do trabalho anterior, o modelo agora pode generalizar para cadeias muito mais longas, pois carrega o resultado incrementalmente e precisa fazer apenas uma pequena quantidade de trabalho em cada etapa.

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjozMjgsIm91dHB1dCI6IlwiUDogZm9vLCBiYXIsIGJheiwgYmxpcCwgbGVhcm4sIHByb21wdGluZywgd29ybGQsIHNoYWtpbmcsIGV2ZW50LCBkYW5jZWZsb29yLCBwcmlzbWEsIGdpcmFmZmVcblxuUjogQSDDumx0aW1hIGxldHJhIGRlIFwiZm9vXCIgw6kgXCJvXCIuIEEgw7psdGltYSBsZXRyYSBkZSBcImJhclwiIMOpIFwiclwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJiYXpcIiDDqSBcInpcIi4gQSDDumx0aW1hIGxldHJhIGRlIFwiYmxpcFwiIMOpIFwicFwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJsZWFyblwiIMOpIFwiblwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJwcm9tcHRpbmdcIiDDqSBcImdcIi4gQSDDumx0aW1hIGxldHJhIGRlIFwid29ybGRcIiDDqSBcImRcIi4gQSDDumx0aW1hIGxldHJ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GVuc2FyLCBtw6FxdWluYSwgZ2VuZXJhbGl6YcOnw6NvXCIgw6kgXCJyYW9cIi5cblxuUDogdHJhbnNmb3JtYXIsIGxpbmd1YWdlbVxuUjogQSDDumx0aW1hIGxldHJhIGRlIFwidHJhbnNmb3JtYXJcIiDDqSBcInJcIi4gQSDDumx0aW1hIGxldHJhIGRlIFwibGluZ3VhZ2VtXCIgw6kgXCJtXCIuIENvbmNhdGVuYW5kbyBcInJcIiBlIFwibVwiIHRlbW9zIFwicm1cIi4gUG9ydGFudG8sIFwidHJhbnNmb3JtYXIsIGxpbmd1YWdlbSBcIiDDqSBcInJtXCIuXG5cblA6IHRyYW5zZm9ybWFyLCBsaW5ndWFnZW0sIHZpc8Ojb1xuUjogXCIgdHJhbnNmb3JtYXIsIGxpbmd1YWdlbVwiIHJlc3VsdGEgZW0gXCJybVwiLiBBIMO6bHRpbWEgbGV0cmEgZGUgXCJ2aXPDo29cIiDDqSBcIm9cIi4gQ29uY2F0ZW5hbmRvIFwicm1cIiBlIFwib1wiIHRlbW9zIFwicm1vXCIuIFBvcnRhbnRvLCBcIiB0cmFuc2Zvcm1hciwgbGluZ3VhZ2VtLCB2aXPDo29cIiDDqSBcInJtb1wiLlxuXG5QOiBmb28sYmFyLGJheixibGlwLGxlYXJuLHByb21wdGluZyx3b3JsZCxzaGFraW5nLGV2ZW50LGRhbmNlZmxvb3IscHJpc21hLGdpcmFmZmUiLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### Resultados

No último problema de concatenação de letras com 12 palavras, Cadeia de Pensamento tem uma precisão de 34%, enquanto Menor para o Maior tem uma precisão de 74% (o artigo utiliza o modelo text-davinci-002).

## Exemplo: Generalização Composicional (SCAN)

O benchmark SCAN (@lake2018scan) exige que o modelo converta linguagem natural em sequências de ações. Por exemplo, a frase "corra para a esquerda e caminhe duas vezes" seria traduzida para "VIRE_ESQUERDA + CORRA + CAMINHE \* 2". Modelos de linguagem têm desempenho especialmente ruim quando confrontados com sequências mais longas do que as do conjunto de treinamento.

### Primeira tentativa: Padrão

Usando um prompt padrão, o text-davinci-003 tem um desempenho bom, mas ainda falha em resolver a pergunta.

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoxMTUsIm91dHB1dCI6IigoVklSQVJfRVNRVUVSREEgKyBQVUxBUikgKiAyICsgKFZJUkFSX0VTUVVFUkRBICogMiArIEFOREFSKSAqIDMpIiwicHJvbXB0IjoiUDogdmlyYXIgw6AgZXNxdWVyZGFcblI6IFZJUkFSX0VTUVVFUkRBXG5cblA6IHZpcmFyIMOgIGRpcmVpdGFcblI6IFZJUkFSX0RJUkVJVEFcblxuUDogcHVsYXIgcGFyYSBlc3F1ZXJkYVxuUjogVklSQVJfRVNRVUVSREEgKyBQVUxBUlxuXG5QOiBjb3JyZXIgcGFyYSBhIGRpcmVpdGFcblI6IFZJUkFSX0RJUkVJVEEgKyBDT1JSRVJcblxuUDogb2xoYXIgZHVhcyB2ZXplc1xuUjogT0xIQVIgKiAyXG5cblA6IGNvcnJlciBlIG9saGFyIGR1YXMgdmV6ZXNcblI6IENPUlJFUiArIE9MSEFSICogMlxuXG5QOiBwdWxhciBwYXJhIGEgZGlyZWl0YSB0csOqcyB2ZXplc1xuUjogKFZJUkFSX0RJUkVJVEEgKyBQVUxBUikgKiAzXG5cblA6IGFuZGFyIGRlcG9pcyBkZSBjb3JyZXJcblI6IENPUlJFUiArIEFOREFSXG5cblA6IHZpcmFyIHBhcmEgYSBlc3F1ZXJkYSBvcG9zdGFcblI6IFZJUkFSX0VTUVVFUkRBICogMlxuXG5QOiB2aXJhci1zZSBwYXJhIGEgZXNxdWVyZGEgXG5SOiBWSVJBUl9FU1FVRVJEQSAqIDRcblxuUDogdmlyYXIgcGFyYSBhIGRpcmVpdGEgb3Bvc3RhXG5SOiBWSVJBUl9ESVJFSVRBICogMlxuXG5QOiB2aXJhci1zZSBwYXJhIGEgZGlyZWl0YVxuUjogVklSQVJfRElSRUlUQSAqIDRcblxuUDogYW5kYXIgbmEgZXNxdWVyZGEgb3Bvc3RhXG5SOiBWSVJBUl9FU1FVRVJEQSAqIDIgKyBBTkRBUlxuXG5QOiBhbmRlIGFvIHJlZG9yIGRhIGVzcXVlcmRhXG5SOiAoVklSQVJfRVNRVUVSREEgKyBBTkRBUikgKiA0XG5cblA6IFwicHVsZSBhbyByZWRvciBkYSBlc3F1ZXJkYSBkdWFzIHZlemVzIGFuZGUgbmEgZXNxdWVyZGEgb3Bvc3RhIHRyw6pzIHZlemVzXCJcIlxuUjoiLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### Segunda tentativa: Menor para o Maior, primeiro passo - Redução

Aqui, trabalhamos com dois prompts diferentes. O primeiro prompt é usado para reduzir o problema de entrada em uma sequência de etapas mais simples. O segundo prompt é usado para mapear essa sequência simplificada de etapas em ações reais.

Ambos os prompts são bastante longos e usam notação Python comprimida para a ação a fim de economizar tokens.

O primeiro passo quebra a descrição da linguagem natural em uma linguagem mais explícita, porém ainda humana. Isso ajudará o passo de mapeamento a entender as coisas em sequência.
Por exemplo, `"pular para a esquerda duas vezes"` é reduzido para `"pular para a esquerda"` -> `virar à esquerda + pular` e `"pular para a esquerda"` -> `(virar à esquerda + pular) * 4`. Da mesma forma, o passo de redução é o que é usado para explicar o conceito de repetição (duas vezes, três vezes, etc.).

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5z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IgcG9kZSBzZXIgcmVzb2x2aWRvIHBvcjogXCJ2aXJlIHBhcmEgYSBkaXJlaXRhXCIuIFwiY29ycmEgcGFyYSBhIGRpcmVpdGEgdHLDqnMgdmV6ZXNcIiBwb2RlIHNlciByZXNvbHZpZG8gcG9yOiBcImNvcnJhIHBhcmEgYSBkaXJlaXRhXCIsIFwiY29ycmEgcGFyYSBhIGRpcmVpdGEgdHLvv71zIHZlemVzXCIuIFBvcnRhbnRvLCBcInZpcmUgcGFyYSBhIGRpcmVpdGEgZGVwb2lzIGNvcnJhIHBhcmEgYSBkaXJlaXRhIHRy77%2B9cyB2ZXplc1wiIHBvZGUgc2VyIHJlc29sdmlkbyBwb3I6IFwidmlyZSBwYXJhIGEgZGlyZWl0YVwiLCBcImNvcnJhIHBhcmEgYSBkaXJlaXRhXCIsIFwiY29ycmEgcGFyYSBhIGRpcmVpdGEgdHLvv71zIHZlemVzXCIuXG5cblA6IHB1bGUgYW8gcmVkb3IgcGFyYSBhIGVzcXVlcmRhIGR1YXMgdmV6ZXMgZGVwb2lzIGNhbWluaGUgb3Bvc3RvIHBhcmEgYSBlc3F1ZXJkYSB0csOqcyB2ZXplcyIsIm1vZGVsIjoidGV4dC1kYXZpbmNpLTAwMyJ9"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### Segunda tentativa: Menor para o Maior, segundo passo - Mapeamento

No segundo passo, usamos a saída da redução e novamente usamos um prompt bem longo (14 casos) para traduzir a descrição reduzida em linguagem natural em uma sequência de ações.

Aqui, injetamos a saída do primeiro passo:

> "pular em volta à esquerda duas vezes" pode ser resolvido por: "pular à esquerda", "pular em volta à esquerda", "pular em volta à esquerda duas vezes". "andar na direção oposta à esquerda três vezes" pode ser resolvido por: "andar na direção oposta à esquerda", "andar na direção oposta à esquerda três vezes". Então, "pular em volta à esquerda duas vezes depois de andar na direção oposta à esquerda três vezes" pode ser resolvido por: "pular à esquerda", "pular em volta à esquerda", "pular em volta à esquerda duas vezes", "andar na direção oposta à esquerda", "andar na direção oposta à esquerda três vezes".

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjoxLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoyNTYsIm91dHB1dCI6IkEgc2HDrWRhIGRlIFwic2FsdGFyIGFvIHJlZG9yIMOgIGVzcXVlcmRhIGR1YXMgdmV6ZXMgYXDDs3MgY2FtaW5oYXIgb3Bvc3RvIMOgIGVzcXVlcmRhIHRyw6pzIHZlemVzXCIgc2Vyw6EgYSBjb25jYXRlbmHDp8OjbyBkYXMgc2HDrWRhcyBpbmRpdmlkdWFpcyBkZSBjYWRhIGZyYXNlIHByZXNlbnRlIG5lc3NhIGV4cHJlc3PDo28uXG5cblwiY2FtaW5oYXIgb3Bvc3RvIMOgIGVzcXVlcmRhXCIgcHJvZHV6IFwiVklSQVIgw4AgRVNRVUVSREFcIiAqIDIgKyBcIkNBTUlOSEFSXCIuXG5SZXBldGlyIGEgc2HDrWRhIGRlIFwiY2FtaW5oYXIgb3Bvc3RvIMOgIGVzcXVlcmRhXCIgdHLDqnMgdmV6ZXMgcmVzdWx0YSBlbSAoXCJWSVJBUiDDgCBFU1FVRVJEQVwiICogMiArIFwiQ0FNSU5IQVJcIikgKiAzLlxuXCJzYWx0YXIgYW8gcmVkb3Igw6AgZXNxdWVyZGEgZHVhcyB2ZXplc1wiIHByb2R1eiAoXCJWSVJBUiDDgCBFU1FVRVJEQVwiICsgXCJTQUxUQVJcIikgKiAyLlxuQWdvcmEsIGNvbWJpbmFuZG8gZXNzYXMgZHVhcyBmcmFzZXM6XG5cblwic2FsdGFyIGFvIHJlZG9yIMOgIGVzcXVlcmRhIGR1YXMgdmV6ZXMgYXDDs3MgY2FtaW5oYXIgb3Bvc3RvIMOgIGVzcXVlcmRhIHRyw6pzIHZlemVzXCIgcmVzdWx0YSBlbSA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Igw6AgZXNxdWVyZGEgZHVhcyB2ZXplcyBhcMOzcyBjYW1pbmhhciBvcG9zdG8gw6AgZXNxdWVyZGEgdHLDqnMgdmV6ZXNcIlxuUjoiLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### Resultados

MpM leva a várias melhorias:

- aumento da precisão em relação à Cadeia de Pensamento
- aumento da generalização em problemas mais difíceis do que os do prompt
- melhoria significativa no desempenho na generalização composicional, em particular no benchmark SCAN (@lake2018scan)

A solicitação padrão com text-davinci-002 (o modelo usado no artigo) resulta em 6% de problemas SCAN resolvidos com sucesso, enquanto a solicitação Menor para o Maior resulta em uma impressionante taxa de sucesso de 76%. Os resultados são ainda mais significativos com code-davinci-002, onde a solicitação Menor para o Maior alcança uma taxa de sucesso de 99,7%.
